﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class MainPanel : MonoBehaviour
{
    public RectTransform SytemBtnObj;
    public RectTransform SystemContentObj;
    public RawImage RFroaterImage;

    private bool systemobjIsAnim = true;


	// Use this for initialization
	void Start () {
        this.SetRFroaterImage();

        Tweener slideButton = SystemContentObj.DOLocalMove(new Vector3(0, 25.0f, 0), 0.5f);
        slideButton.SetAutoKill(false);
        slideButton.Pause();

        Tweener sytemBtnOBj = SytemBtnObj.DOLocalRotate(new Vector3(0,0, 45),0.5f,RotateMode.Fast);
        sytemBtnOBj.SetAutoKill(false);
        sytemBtnOBj.Pause();
    }

    public void SystemBtnObjAnim()
    {
        if (this.systemobjIsAnim)
        {
            SytemBtnObj.DOPlayForward();
            SystemContentObj.DOPlayForward();
            this.systemobjIsAnim = false;
        }
        else
        {
            SytemBtnObj.DOPlayBackwards();
            SystemContentObj.DOPlayBackwards();
            this.systemobjIsAnim = true;
        }
        
    }
    /// <summary>
    /// 设置SetRFroaterImage
    /// </summary>
    public void SetRFroaterImage()
    {
        RFroaterImage.texture = ResourceManager.Instance.LoadAsset<RenderTexture>(@"textures\rendertextures\RFRoater");
    }
    /// <summary>
    /// 
    /// </summary>
    private void ShowItemList()
    {

    }


    public void OnPackageClicked()
    {
        this.SystemBtnObjAnim();
        UIManager.Instance.CreateUIByName(UINameDef.PackagePanel);
    }

    #region 构建一堆假数据

    #endregion 
}
